import { createSlice } from '@reduxjs/toolkit'

const initialState = {
    pic: '',
    name: ''
}

export const userSlice = createSlice({
    name: 'user',
    initialState,
    reducers: {
        setUserInfo(state, action) {
            state.pic = action.payload.pic
            state.name = action.payload.name
        }
    },
})

// Action creators are generated for each case reducer function
export const { setUserInfo } = userSlice.actions

export default userSlice.reducer